package com.alibaba.user.service;

import com.alibaba.dubbo.UserService;
import com.alibaba.modle.common.ResponseEntity;
import com.alibaba.modle.user.User;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

/**
 * @Author: TongRui乀
 * @Date: 2021/8/22 11:05
 * @description：
 */
@Slf4j
@Service
@DubboService
public class UserServiceImpl implements UserService {
    @Override
    public ResponseEntity<User> getUserById(Integer id) {

        log.info("getUserById id:{}", id);

        return ResponseEntity.<User>builder()
                .code(200)
                .msg("success")
                .data(User.builder()
                        .id(id)
                        .name("Jack")
                        .address("北京")
                        .sex((short)1)
                        .phone("16689078765")
                        .build())
                .build();
    }
}
